#pragma once


// CCffexVarietyDlg dialog

class CCffexVarietyDlg : public CDialog
{
	DECLARE_DYNAMIC(CCffexVarietyDlg)

	struct VarietyControl 
	{
		CStatic prefix;
		CEdit multiple;
		CEdit unitPrice;
		CEdit majorMargin;
		CEdit minorMargin;
		CEdit minorCode;
		CEdit percentOpenCharge;
		CEdit percentOffsetCharge;
		CEdit percentOffsetTodayCharge;
		CEdit fixedOpenCharge;
		CEdit fixedOffsetCharge;
		CEdit fixedOffsetTodayCharge;
	};

public:
	CCffexVarietyDlg(ParameterSet& parameterSet);   // standard constructor
	virtual ~CCffexVarietyDlg();

// Dialog Data
	enum { IDD = IDD_CFFEX_VARIETY_DLG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog();

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedOk();

private:
	bool ValidateCheck();
	void DisablePercentFeeControls(char const* prefix, VarietyControl* control);
	VarietyControl* CreateVarietyControls(VarietyParameter const& parameter, RECT controlRect, int startId);

private:
	ParameterSet& m_parameterSet;
	vector<shared_ptr<VarietyControl>> m_varietyControls;
	vector<string> m_percentChargePrefix;
};
